package view;
import com.cloudgarden.layout.AnchorConstraint;
import com.cloudgarden.layout.AnchorLayout;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;

import javax.swing.ImageIcon;
import javax.swing.JButton;

import javax.swing.Icon;
import javax.swing.WindowConstants;
import javax.swing.border.BevelBorder;
import javax.swing.border.SoftBevelBorder;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.text.StyledEditorKit.BoldAction;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class Login extends javax.swing.JFrame {
	public Login() {
		super();
		initGUI();
	
	}
//	{
//		//Set Look & Feel
//		try {
//			javax.swing.UIManager.setLookAndFeel("com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
//		} catch(Exception e) {
//			e.printStackTrace();
//		}
//	}

	private JButton jButtonOK;
	private JButton jButtonCancelar;
	private JTextField jTextFieldNome;
	private JTextField jTextFieldSenha;
	private JLabel jLabelteste;
	private JLabel jLabelSenha;
	private JLabel jLabelNome;
	
	//colok a imagem em Background
//	ImageIcon imgBackground = new ImageIcon("C:/Users/Thiago/workspace/Login/src/livros2.png");
//	protected void paintComponent( Graphics g )  
//	    {  
//	       super.paintComponent(g);  
//	       imgBackground.paintIcon(this,g,0,0);//inicio a img no canto superior esquerdo do monitor  
//	    }; //Fim de colok a imagem em BAckground 
	/**
	* Auto-generated main method to display this 
	* JPanel inside a new JFrame.
	*/
	
	private void initGUI() {
		try {
			AnchorLayout thisLayout = new AnchorLayout();
			this.setLayout(thisLayout);
	        setPreferredSize(new Dimension(400, 300));
	        this.setTitle("Login");
	        getContentPane().setForeground(new java.awt.Color(192,192,192));
	        this.setIconImage(new ImageIcon(getClass().getClassLoader().getResource("file/icone-chave-login.png")).getImage());
	        getContentPane().setBackground(new java.awt.Color(192,192,192));

			{
				jTextFieldSenha = new JTextField();
				getContentPane().add(jTextFieldSenha, new AnchorConstraint(528, 654, 643, 154, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				jTextFieldSenha.setPreferredSize(new java.awt.Dimension(192, 30));
				jTextFieldSenha.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
			}
			{
				jLabelSenha = new JLabel();
				getContentPane().add(jLabelSenha, new AnchorConstraint(324, 437, 489, 156, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				jLabelSenha.setText("Senha:");
				//JLabelSenha.setFont(new Font("Courier", Font.BOLD + Font.ITALIC, 20));
				jLabelSenha.setPreferredSize(new java.awt.Dimension(110, 45));
				jLabelSenha.setForeground(Color.BLACK);
				jLabelSenha.setFont(new Font("Senha:", Font.BOLD,14));

				
			}
			{
				jTextFieldNome = new JTextField();
				getContentPane().add(jTextFieldNome, new AnchorConstraint(215, 654, 333, 154, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				jTextFieldNome.setPreferredSize(new java.awt.Dimension(192, 31));
				jTextFieldNome.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
			}
			{
				jLabelNome = new JLabel();
				getContentPane().add(jLabelNome, new AnchorConstraint(64, 383, 236, 149, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				jLabelNome.setText("Nome:");
				jLabelNome.setPreferredSize(new java.awt.Dimension(92, 47));
				jLabelNome.setForeground(Color.BLACK);
				jLabelNome.setFont(new Font("Nome:",Font.BOLD,14));
			}
			{
				jButtonCancelar = new JButton();
				getContentPane().add(jButtonCancelar, new AnchorConstraint(776, 805, 944, 691, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				//jButtonCancelar.setText();
				jButtonCancelar.setPreferredSize(new java.awt.Dimension(44, 44));
				jButtonCancelar.setBackground(new java.awt.Color(255,0,0));
				jButtonCancelar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("file/cancelar.jpg")));
				jButtonCancelar.setOpaque(false);
				jButtonCancelar.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
			}
			{
				jButtonOK = new JButton();
				getContentPane().add(jButtonOK, new AnchorConstraint(780, 954, 944, 837, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				jButtonOK.setPreferredSize(new java.awt.Dimension(45, 43));
				jButtonOK.setBackground(new java.awt.Color(0,255,64));
				jButtonOK.setIcon(new ImageIcon(getClass().getClassLoader().getResource("file/ok.jpg")));
				jButtonOK.setOpaque(false);
				jButtonOK.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));

				jButtonOK.addActionListener(new ActionListener() {
					
					@Override
					public void actionPerformed(ActionEvent arg0) {
						TelaPrincipal telaPrincipal = new TelaPrincipal();
						setVisible(false);
						telaPrincipal.show();
					}
				});
			}
			pack();
			this.setSize(300, 200);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
